import request from './../utils/request'

export function createBook(book) {
  return request({
    url: '/book/create',
    method: 'post',
    data: book
  })
}

export function updateBook(book) {
  return request({
    url: '/book/update',
    method: 'post',
    data: book
  })
}

export function cancelupload(book) {
  return request({
    url: '/book/cancelupload',
    method: 'post',
    data: book
  })
}

export function getbook(fileName) {
  return request({
    url: '/book/getbook',
    method: 'get',
    params: { fileName }
  })
}

export function getCategory() {
  return request({
    url: '/book/getcategory',
    method: 'get'
  })
}

export function getBookList(params) {
  return request({
    url: '/book/getbooklist',
    method: 'get',
    params
  })
}

export function deleteBook(book) {
  return request({
    url: '/book/delete',
    method: 'post',
    data: book
  })
}
